home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17147 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: pub.news.uk.psi.net!usenet
  2. From: Andrew Palmer <a.palmer@kainos.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Templates as the type of a template
  5. Date: Thu, 11 Apr 1996 15:21:59 +0100
  6. Organization: Kainos Software Ltd.
  7. Message-ID: <316D1587.167EB0E7@kainos.com>
  8. NNTP-Posting-Host: 193.195.13.27
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (X11; I; SunOS 4.1.3 sun4c)
  13.  
  14. Hello,
  15.  
  16.   I'm using Sun's CC compiler from Sparcworks 3.0.1 and I'm having a
  17. little trouble passing a template class as the type of another template
  18. class.
  19.  
  20.   I have one template class called "list" and I can use "list<int> foo"
  21. fine.
  22.   I have another template class called "vector" and I can use
  23. "vector<int> bar;" fine as well.
  24.  
  25.   But I don't seem to be able to have a list of vectors of type int,
  26. e.g. "list<vector<int>> foobar;" doesn't work.
  27.  
  28.   I can get round the problem by "typedef vector<int> iVector;
  29. list<iVector> foobar;"
  30.  
  31.   Am I doing something wrong in the syntax or is it just one of those
  32. things that doesn't work?
  33.  
  34.  
  35. ************************************
  36. * Andrew H. Palmer                 *
  37. * - work: a.palmer@kainos.com      *
  38. * - home: andrew@ghost.demon.co.uk *
  39. ************************************
  40.